Visualizing Changes In Opioid Treatment Policy

Please note: This notebook uses open access data

J Montgomery Maxwell

Define Data Mappings

Dictionary for mapping the names of States and Territories to their respective abbreviations. Create additional mappings for cleaning data.

Import And Clean Data

Import data using the Gen3 Python SDK. Importing three data files and their respective codebooks.

Here we look at three key features for U.S. States. The code name for the policy is listed at the end of each line.

Single & Multi Feature Choropleth Maps

You can create choropleth maps using the plotly.express.choropleth package.

Both discrete and continuous data can be represented in these plots.

You can show multiple features or the same feature over a period of time using the 'animation_frame' argument. Here we create an interactive plot which allows us to toggle between the three changes in public health policy which we are investigating.